package com.example.his.api.controller.form;

import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
public class SearchDeptByPageForm {

  @Pattern ( regexp = "^[0-9a-zA-Z\\u4e00-\\u9fa5]{1,10}$", message = "deptName内容不正确" )
  private String deptName;

  @NotNull ( message = "page不能为空" )
  @Min ( value = 1, message = "page不能小于1" )
  private Integer page;

  @NotNull ( message = "length不能为空" )
  @Range ( min = 10, max = 50, message = "length必须为10~50之间" )
  private Integer length;
}

